﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace DanielVaughan.Calcium.Modules.History
{
	/// <summary>
	/// Interaction logic for HistoryView.xaml
	/// </summary>
	public partial class HistoryView
	{
		public HistoryView()
		{
			InitializeComponent();
		}

		HistoryViewModel HistoryViewModel
		{
			get
			{
				return (HistoryViewModel)ViewModel;
			}
		}

		void TextBlock_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
		{
			var selectedItem = sender as FrameworkElement;
			if (selectedItem == null)
			{
				return;
			}
			var selectedTask = selectedItem.DataContext as TaskDetails;
			if (selectedTask == null)
			{
				return;
			}
			HistoryViewModel.RollBackToTask(selectedTask);
		}
	}
}
